// 主界面
;
define(function(require, exports, module) {
	'use strict';
	var util = require("util");
	var base = require(CONFIG.BasePath + "js/platform/base");
	var router = require("../hash/pageRouter");
	var constant = require("constant");
	var css_pickup = require("./tallyingDetailInfo.css");
	var databind = require("databind");
	var tallyingId;
	var dialog = require("dialog");
	var inventoryState;
	var html_updateWaybillNumber = require("./html_updateWaybillNumber.html");
	var inventoryId = [];
	var remark;
	var tools = require("tools");

	var init = function(page) {
		tallyingId = page.params.tallyingId;
		
		tools.loadList("inquireTallyingDetail.json", $("#tallyingDetailInfoBody"), $("#tallyingDetailInfoTpl"), {tallyingId: tallyingId}, function(){
			$("#tallyingDetailInfo .detainedDetail").unbind("click").click(function(){
				router.route("bulkstockTallyDetail/bulkstockTallyDetail.html?inventoryHistoryId="+$(this).parents("tr").attr("inventoryHistoryId"));
			});
		});
		router.init();
		initEvent();
	};

	var initEvent = function() {
		if (base.getData("sid") == null) {
			location.href = "../login/login.html";
		}
		
	};
	
	return {
		init: init
	};
});